#!/usr/bin/perl

use utf8;
use strict;

my $str = 'Thisisatest.';
my $sub = 'is';

my @places;

for (my $pos = -1; ; ) {
	$pos = index($str, $sub, $pos + 1);
	last if $pos == -1;
	push @places, $pos;
}

print "@places \n";